#include "StdAfx.h"
#include "RegKey.h"
#include "RegFormat.h"

RegKey::RegKey(void)
{
}

RegKey::~RegKey(void)
{
}

void RegKey::Clear()
{
	valueArray_.clear();
	SetName(_T(""));
}

bool RegKey::IsEmpty()
{
	return valueArray_.size() == 0 && GetName() == _T("");
}

CString RegKey::ToNameString()
{
	CString text;
	RegFormat::KeyNameToText(*this,text);
	return text;
}

void RegKey::ToAllString()
{
	X_Printf(_T("%s\r\n"),ToNameString());
	for (ValueArrayIter iter = valueArray_.begin();iter != valueArray_.end();++iter)
	{
		X_Printf(_T("%s\r\n"),iter->ToString());
	}
}